<template>
	<view class="content">
		<text style="font-size:50rpx;">子组件A</text>
		<view class="coma box">
			<text>父组件传进来的值:</text>
			<text style="font-weight: bold;color: red;">{{intent}}</text>
		</view>
		<button type="primary" @click="sendData()">传值给CompB组件</button>
	</view>
</template>

<script>
	export default {
		props: ['intent'],
		name: "ComA",
		data() {
			return {
			
			};
		},
		 methods: {
		    sendData() {
		      this.$emit('sendToB', this.intent)
		    }
		  }
	}
</script>

<style>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #fbb034; /* 子组件A的橙色背景 */
  padding: 30rpx;
  border-radius: 12rpx;
  margin-bottom: 30rpx;
}
.content text {
  font-size: 50rpx;
  font-weight: bold;
  margin-bottom: 20rpx;
}
.coma.box {
  display: flex;
  align-items: center;
  margin-bottom: 20rpx;
}
.coma.box text {
  margin-right: 10rpx;
  font-size: 32rpx;
}
button {
  padding: 12rpx 24rpx;
  border-radius: 8rpx;
}
</style>